package com.demo.user.controller;

import com.demo.common.base.pojo.JsonRes;
import com.demo.user.bo.UserMainPageBO;
import com.demo.user.entity.UserMain;
import com.demo.user.service.UserMainService;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户管理接口
 *
 * @author DayDayUp
 * create on 2023-05-18
 **/
@RestController
@RequestMapping("userMain")
public class UseMainController {
    @Resource
    private UserMainService userMainService;


    /**
     * 分页查询用户
     * @param userMainPageBO 分页条件
     * @return JsonRes
     */
    @GetMapping("pageUserMain")
    public JsonRes<Page<UserMain>> pageUserMain(UserMainPageBO userMainPageBO) {
        Page<UserMain> userMainPage = userMainService.pageUserMain(userMainPageBO);
        return JsonRes.ok(userMainPage);
    }



}
